package com.hao.wms.mvc;

import com.hao.wms.VO.OrderGroupByType;
import com.hao.wms.query.OrderChartQueryObject;
import com.hao.wms.service.IOrderChartService;
import com.hao.wms.service.ISupplierService;

public class ChartAction extends BaseAction{
    private IOrderChartService orderChartService;
    private ISupplierService supplierService;
    private OrderChartQueryObject queryObject = new OrderChartQueryObject();

    public void setOrderChartService(IOrderChartService orderChartService) {
        this.orderChartService = orderChartService;
    }

    public void setSupplierService(ISupplierService supplierService) {
        this.supplierService = supplierService;
    }

    public OrderChartQueryObject getQueryObject() {
        return queryObject;
    }

    public void setQueryObject(OrderChartQueryObject queryObject) {
        this.queryObject = queryObject;
    }

    public String orderChart(){
        putContext("orderCharts",orderChartService.queryOrderChart(queryObject));
        putContext("suppliers",supplierService.list());
        putContext("groups", OrderGroupByType.values());
        return "orderChart";
    }
}
